from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from options import *
url="https://www.baidu.com/"
driver = webdriver.Chrome(options=options, service=service)
driver.get(url)
sleep(3)
# 1.id定位
# driver.find_element(By.ID,"kw").send_keys("id定位")
# driver.find_element(By.ID,"su").click()
# sleep(3)
# # 2.name定位
# driver.find_element(By.NAME,'wd').send_keys('name定位')
# driver.find_element(By.ID,"su").click()
# sleep(3)
# # 3.tag定位
# driver.find_elements(By.TAG_NAME,'inpupt')[7].send_keys('tag定位')
# driver.find_elements(By.TAG_NAME,'input')[8].click()
# sleep(3)
# 4 class定位，只能输入单个属性
driver.find_element(By.CLASS_NAME,'s_ipt').send_keys('class定位')
sleep(3)
# driver.find_elements(By.CLASS_NAME,'bg')[2].click()
driver.find_element(By.CLASS_NAME,'s_btn').click()
sleep(3)
# 5.xpath定位
# driver.quit()
